﻿using UserSystem.Model;

namespace UserSystem.BLL
{
    public class LoginManage
    {
        /// <summary>
        /// 处理登录
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="password">密码</param>
        /// <param name="msg">本次执行的消息</param>
        /// <returns></returns>
        public static UserInfoToClient Login(string account, string password, out string msg)
        {
            UserInfoToClient modelResult;
            if (account == "haoshaonian" && password == "666")
            {
                modelResult = new UserInfoToClient();
                modelResult.userName = "好少年";
                modelResult.token = "djkfakdfhahgjkasdkfhasgjasfhas90091880";
                msg = "登录成功。";
            }
            else
            {
                modelResult = null;
                msg = "账户名或者密码不正确。";
            }
            return modelResult;
        }
    }
}
